Hi, Below you will find my first SUM. J. Madrigal pointed out that the script could crash ArcView and showed a workaround. Thanks. ----------------- J. Madrigal advice ----------- Be careful with the script that you posted on the ArcView listserv. If you issue an Empty command to an already empty listbox then ArcView will crash! This was happening to me all the time until I found this bug. (not sure if 3.2a fixed this problem) So you might want to add something like this for list and combo boxes if ( c.GetRowCount <> 0) then c.Empty end I think this is only true for list boxes but you can put similar checks for all types (i.e., if (c.IsEmpty.Not) then c.Empty end). ------------------ End J. Madrigal advice ------ ------------------ Original SUM ---------------- >Thanks to François CABRIEL (fcabriel@hdr.cr-paca.fr) and Shaun McGee (smcgee@craworld.com) > >My original post : >------ >I'm creating dialogs for an extension ; of course I test them before creating >the extension. But when I test a dialog, its content remains linked to it. > >For example I have a listbox showing the current view themes. If I create the >extension after testing the dialog, I will be prompted to locate the source >files when I load the extension on another computer. > >I avoid this problem by resetting the dialog : I move one of the dialog >control so I can re-compile the dialog, and then immediately create the >extension and everything is fine. > >So it works but it is painful especially when there are many dialogs. Is >there a better way ? >------- > >I wasn't clear enough : the problem was not at the dialog start but at the extension load that's why Shaun McGee advised me to "try initializing all controls (set their default values) when you start the dialog". Can be helpfull for other people though. > >However François CABRIEL sent me the perfect solution for my needs : >I have to reset all the controls before I add dialogs to the extension (in the make.extension script). He sent me the following code : > >' Controls clean-up >' ------------------------- >aDialog.SetObjectTag(nil) >for each c in aDialog.FindByClass(Control) > c.SetObjectTag(nil) > if ( c.Is(ComboBox) or c.Is(ListBox) or c.Is(TextBox) or c.Is(TextLine)) then > c.Empty > end > if ( c.Is(IconBox) ) then > c.SetIcon(nil) > end >end > >Thanks again > > >Michael Delorme -------- End original SUM -------- ______________________________________________ Conservatoire Botanique National Mediterraneen Ile de Porquerolles F-83400 Hyeres France tel : 04 94 12 30 32 mailto:cbn.ile@wanadoo.fr ______________________________________________